<template>
  <div class="topHeader">
    <div class="headerContent">
      <!-- <i class="el-icon-arrow-left"></i> -->
      <span  @click="back">
        <svg t="1569289747244" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1980" width="16" height="16"><path d="M671.807 927.804l-415.632-415.804 415.632-415.803 63.445 63.616-352.017 352.209 352.017 352.102z" p-id="1981" fill="#353535"></path></svg>
      </span>

      <h2 class="centerMsg">{{ centerMsg }}</h2>
<!--      <button @click="record" class="btnTX " v-if="typeVal =='申请提现' " >提现记录</button >
      <h3 class="rightMsg " v-else>{{rightMsg}}</h3>-->
    </div>
  </div>
</template>

<script>
export default {
  name: 'TopHeader',
  props: {
    centerMsg: String,
    rightMsg:String,
    typeVal:String,
    backPath:String,
  },
  methods:{
    back(){
      // this.$router.push('/recordWithdraw')
      if (this.backPath) {
        this.$router.push({
          path: this.backPath
        })
      } else {
        this.$router.go(-1);
      }
    }
  }
}
</script>

<style  lang="less">
// 公共样式
@import '../style/index.less';
h2,h3{
  font-weight: normal;
}
  .topHeader{
    position: fixed;
    top:0;
    left: 0;
    width: 100%;
    height:3rem;
    line-height: 3rem;
    background-color: #fff;
    // background-color: #ccc;
    .headerContent{
      height: 100%;
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin: 0 1rem;
      position: relative;

      .centerMsg{
        width: 100%;
        display: flex;
        justify-content:center;
        align-items: center;
        font-size: 1.1rem;
        font-weight: 700;
        color: #000;
      }

      .btnTX{
        position: absolute;
        right: 0;
        height: 1.5rem;
        width: 4rem;
        font-size:0.6rem;
        color: @pt;
        background: none;
        border:1px solid @zy;
        border-radius: 20px;
      }
      .icon{
        position: absolute;
        left: 0;
        top:50%;
        margin-top: -8px;
        height: 16px;
        width: 16px;
      }
       .rightMsg{
        position: absolute;
        right: 0;
        font-size: 1rem;
        // top:50%;
      }
    }
  }
</style>

